// 统一请求路径前缀在libs/axios.js中修改
import {
  getRequest,
  putRequest,
  postRequest,
  deleteRequest,
  managerUrl,
} from "@/libs/axios";

// 获取学生用户分页列表
export const getStudentPage = (params) => {
  return getRequest(`${managerUrl}/manager/passport/student`, params);
};

// 学院、专业下拉列表
export const getSchoolDropList = (params) => {
  return getRequest(`${managerUrl}/manager/passport/student/getCollegeNameList`, params);
};
// 班级下拉列表
export const classDropDown = (params) => {
  return getRequest(`${managerUrl}/manager/passport/student/classDropDown`, params);
};

// 年级下拉列表
export const gradeDropDown = (params) => {
  return getRequest(`${managerUrl}/manager/passport/student/gradeDropDown`, params);
};

// 新增学生用户
export const postAddStudent = (params) => {
  return postRequest(`${managerUrl}/manager/passport/student`, params);
};

// 重置学生用户密码
export const postStudentResetPassword = (mobiles) => {
  return postRequest(`${managerUrl}/manager/passport/student/resetPassword/${mobiles}`);
};

// 编辑学生用户
export const putUpdateStudent = (params) => {
  let headers = { "Content-Type": "application/json"};
  return putRequest(`${managerUrl}/manager/passport/student`, params, headers);
};

// 删除学生用户
export const delStudent = (ids) => {
  return deleteRequest(`${managerUrl}/manager/passport/student/${ids}`);
};

// 禁-启用学生用户状态
export const putStudentStatus = (params) => {
  return putRequest(`${managerUrl}/manager/passport/student/enable/${params.id}`, params);
};

// 同步学生数据
export const getAsyncStuData = () => {
  return getRequest(`${managerUrl}/manager/passport/student/syncStudentInfo`);
};

// 同步教师数据
export const getAsyncTeachData = () => {
  return getRequest(`${managerUrl}/manager/passport/teacher/syncTeacherInfo`);
};

// 下载模板
export const getTemplateInfo = (params) => {
  return getRequest(`${managerUrl}/manager/user/template`, params);
};

// 导入学生
export const postImportStudent = (params) => {
  let headers = { 'Content-Type': 'multipart/form-data' };
  return postRequest(`${managerUrl}/manager/passport/student/import`, params, headers, 10 * 60 * 1000);
};

// 获取教师用户分页列表
export const getTeacherPage = (params) => {
  return getRequest(`${managerUrl}/manager/passport/teacher`, params);
};

// 部门下拉列表
export const getDeptList = (params) => {
  return postRequest(`${managerUrl}/manager/passport/teacher/deptList`, params);
};

// 新增教师用户
export const postAddTeacher = (params) => {
  return postRequest(`${managerUrl}/manager/passport/teacher`, params);
};

// 导入教师
export const postImportTeacher = (params) => {
  let headers = { 'Content-Type': 'multipart/form-data' };
  return postRequest(`${managerUrl}/manager/passport/teacher/import`, params, headers, 10 * 60 * 1000);
};

// 导出教师
export const postExportTeacher = (params) => {
  return postExport(`${managerUrl}/manager/passport/teacher/export`, params);
};

// 重置教师用户密码
export const postTeacherResetPassword = (mobiles) => {
  return postRequest(`${managerUrl}/manager/passport/teacher/resetPassword/${mobiles}`);
};

// 编辑教师用户
export const putUpdateTeacher = (params) => {
  let headers = { "Content-Type": "application/json"};
  return putRequest(`${managerUrl}/manager/passport/teacher`, params, headers);
};

// 删除教师用户
export const delTeacher = (ids) => {
  return deleteRequest(`${managerUrl}/manager/passport/teacher/${ids}`);
};

// 禁-启用教师用户状态
export const putTeacherStatus = (params) => {
  return putRequest(`${managerUrl}/manager/passport/teacher/enable/${params.id}`, params);
};

// 上架、下架专家
export const postExpertPut = (params) => {
  let headers = { 'Content-Type': 'multipart/form-data' };
  return postRequest(`${managerUrl}/manager/user/expert/isOnline`, params, headers);
};

// 获取专家分页列表
export const postExpertPage = (params) => {
  return postRequest(`${managerUrl}/manager/expert/expert/list`, params);
};

// 专家审核
export const postExpertExamine = (params) => {
  let headers = { "Content-Type": "application/json"};
  return postRequest(`${managerUrl}/manager/expert/expert/examine`, params, headers);
};

// 获取护士管理列表
export const postNursePage = (params) => {
  return postRequest(`${managerUrl}/manager/user/expert/listNurse`, params);
};

// 添加护士
export const postNurseAdd = (params) => {
  let headers = { "Content-Type": "application/json"};
  return postRequest(`${managerUrl}/manager/user/expert/addNurse`, params, headers);
};

// 编辑护士
export const postNurseUpdate = (params) => {
  let headers = { "Content-Type": "application/json"};
  return postRequest(`${managerUrl}/manager/user/expert/updateNurse`, params, headers);
};

// 删除护士
export const delNurse = (params) => {
  return postRequest(`${managerUrl}/manager/user/expert/deleteNurse`, params);
};

// 获取场地列表
export const getYardList = (params) => {
  return getRequest(`${managerUrl}/manager/site/site/list`, params);
};
